package com.hirelinfo.dto.student;


import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.NumberFormat;
import org.springframework.format.annotation.NumberFormat.Style;

@Entity
@Table(name="STUDENT")
public class Student {

	@NumberFormat(style=Style.NUMBER)

	private int id;
	private String name;
	private String fname;
	private String gender;
	private String address;
	private String email;
	private String course;
	private long contact;
	private String inDate;
	private String validDate;
	
	
	@NotNull(message="Student ID should not be Empty.")
	@Min(value=2,message="Student ID is not Valid.")
	@Id
	public int getId() {
		return id;
	}
	
	@NotEmpty(message="Student Name should not be Empty.")
	@NotBlank(message="Student name should be Required")
	public String getName() {
		return name;
	}
	@NotEmpty(message="Father's name should not be Empty.")
	@NotBlank(message="Father's name should be Required")
	public String getFname() {
		return fname;
	}
	@NotEmpty(message="Gender should not be Empty.")
	@NotBlank(message="Gender should be Required")
	public String getGender() {
		return gender;
	}
	@NotEmpty(message="Address should not be Empty.")
	@NotBlank(message="Address should be Required")
	public String getAddress() {
		return address;
	}
	@NotEmpty(message="Email Id should not be Empty.")
	@NotBlank(message="Email should be Required")
	public String getEmail() {
		return email;
	}
	@NotEmpty(message="Course should not be Empty.")
	@NotBlank(message="Course should be Required")
	public String getCourse() {
		return course;
	}
	
	
	@NumberFormat(style=Style.NUMBER)
	@Min(value=10,message="Contact number is not Valid.")
	public long getContact() {
		return contact;
	}
	@NotEmpty(message="Issue Date should not be Empty.")
	@Length(min=10,max=10, message="Date should be [dd/mm/yyyy] Required.")
	public String getInDate() {
		return inDate;
	}
	@NotEmpty(message="Valid Date should not be Empty.")
	@Length(min=10,max=10, message="Date should be [dd/mm/yyyy] Required.")
	public String getValidDate() {
		return validDate;
	}
	public void setId(int id) {
		this.id = id;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setFname(String fname) {
		this.fname = fname;
	}
	public void setGender(String gender) {
		this.gender = gender;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public void setCourse(String course) {
		this.course = course;
	}
	public void setContact(long contact) {
		this.contact = contact;
	}
	public void setInDate(String inDate) {
		this.inDate = inDate;
	}
	public void setValidDate(String validDate) {
		this.validDate = validDate;
	}
	
}
